<%@page import="com.ksyzt.ksite2.server.database.dao.impl.NEWSDAOImpl"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.INEWSDAO"%>
<%@page import="com.ksyzt.ksite2.server.common.PageNaviData"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObj"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObjs"%>
<%@page import="com.ksyzt.ksite2.client.column.ColumnType"%>
<%@page import="com.ksyzt.ksite2.shared.modle.COLUMNObjs"%>
<%@page import="com.ksyzt.ksite2.shared.modle.COLUMNObj"%>
<%@page import="com.ksyzt.ksite2.shared.PageData"%>
<%@page import="com.ksyzt.ksite2.server.common.Application"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
	+ request.getServerName() + ":" + request.getServerPort()
	+ path + "/";
	Application app=new Application(request,response);
	PageData pd=app.getApplicationPageData();
	
	int cid=app.parameterAsInteger("cid", 2);
	int subcid=app.parameterAsInteger("subcid", -1);
	COLUMNObj subcolumn=null;
	
	COLUMNObjs cs =app.getChildColumns(cid);
	for(COLUMNObj c:cs)
	{
		if(c.getID()==subcid)
		{
	subcolumn=c;
	break;
		}
	}
	if(subcolumn==null)
	{
		if(cs.size()>0)
		{
	subcolumn=cs.get(0);
		}
	}
	
	//专题根目录
	COLUMNObj column=app.getColumn(cid);
	long count=0;
	
	INEWSDAO dao =new NEWSDAOImpl(Application.getConnection());
	
	if(subcolumn==null)
	{
		
		count=dao.getCountByWhereTemplate("where oid=?", column.getID());
	}
	else
	{
		count=dao.getCountByWhereTemplate("where oid=?", subcolumn.getID());
		subcid =subcolumn.getID();
	}
	
	long currentpage=app.parameterAsLong("page", 0l);
	
	long pagesize=app.parameterAsLong("pagesize",20l);
	PageNaviData navidata=new PageNaviData("news/normal.jsp?cid="+cid+"&subcid="+subcid,count,pagesize,currentpage);
	
	String style="newslist";
	boolean showpicture=false;
	if(subcid==17)
	{
		style="tpztlist";
		showpicture=true;
	}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=pd.getName()%>-<%=column.getNAME()%></title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="<%=pd.getKeyWords()%>" />
<meta http-equiv="description" content="<%=pd.getSummary()%>" />
<link rel="stylesheet" type="text/css" href="css/comm.css" />
<style type="text/css">
.newslist {
	width: 721px;
}

.newslist-top {
	display: none;
	width: 100%;
	border: 1px solid #a8ccee;
	float: left;
	background: url(images/column_top.png) no-repeat;
	height: 34px;
	margin: 0px 0px 0px 0px;
}

.newslist-top-title {
	line-height: 34px;
	padding: 0px 0px 0px 18px;
	font-size: 14px;
	font-family: 宋体;
	font-weight: bold;
	color: #333;
}

.newslist-top-more {
	display: none;
	float: right;
	margin: 5px 6px 0px 0px;
	width: 41px;
	height: 17px;
}

.newslist-top-more-link {
	text-decoration: none;
	width: 41px;
	height: 17px;
	display: block;
	background: url(images/more1.gif) no-repeat;
}

.newslist-top-more-link:hover {
	width: 41px;
	height: 17px;
	display: block;
	background: url(images/more2.gif) no-repeat;
}

.newslist-top-tabs {
	border-top: solid 1px #9cd9f5;
	margin: 0px;
	padding: 0px;
	display: block;
}

.newslist-top-tabs ul {
	width: 100%;
	border-top: solid 1px #9cd9f5;
	margin: 0px;
}

.newslist-top-tabs .unselected {
	overflow: hidden;
	color: #505050;
	height: 26px;
	line-height: 26px;
	background: url(images/480_box_normal.gif) repeat-x;
	list-style: none;
	float: left;
	padding: 0px 2px 0px 2px;
	width: 115px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	border-bottom: solid 1px #a8ccee;
	border-left: solid 1px #a8ccee;
	border-collapse: separate;
	font-size: 12px;
	font-family: 宋体;
}

.newslist-top-tabs .selected {
	overflow: hidden;
	color: darkblue;
	font-weight: bold;
	text-decoration: none;
	height: 26px;
	line-height: 26px;
	background: url(images/480_box_select.gif) repeat-x;
	list-style: none;
	float: left;
	padding: 0px 2px 0px 2px;
	width: 115px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	border-bottom: solid 0px #9cd9f5;
	border-left: solid 1px #9cd9f5;
	font-size: 12px;
	font-family: 宋体;
}

.newslist-content {
	width: 100%;
}

.newslist-content-tab ul {
	margin: 5px 0px 0px 0px;
	padding: 0px;
}

.newslist-content-tab li {
	line-height: 200%;
	height: 30px;
	border-top: dashed 1px #505050;
	font-size: 12px;
	font-family: 宋体;
	list-style: none;
	padding: 0px 0px 0px 22px;
	background: url(images/item_indicator.png) 6px 9px no-repeat;
}

.newslist-content-tab a {
	width: 635px;
	text-decoration: none;
	color: #333;
	float: left;
	line-height: 30px;
	display: block;
	height: 30px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
	font-family: 宋体;
}
.newslist-content-tab a[isnew='1'] {
	width: 605px;
}

.newslist-content-tab .text {
	text-align: center;
	line-height: 26px;
	margin: 6px auto;
	font-size: 14px;
}

.newslist-content-tab a:hover {
	color: red;
	background-color: #f0f0f0;
}

.newslist-content-tab span {
	font-size: 12px;
	float: left;
	width: 60px;
	display: block;
}

.newslist-content-tab li:FIRST-CHILD {
	border-top: solid 0px skyblue;
}



.tpztlist {
	width: 721px;
}

.tpztlist-top {
	display: none;
	width: 100%;
	border: 1px solid #a8ccee;
	float: left;
	background: url(images/column_top.png) no-repeat;
	height: 34px;
	margin: 0px 0px 0px 0px;
}

.tpztlist-top-title {
	line-height: 34px;
	padding: 0px 0px 0px 18px;
	font-size: 14px;
	font-family: 宋体;
	font-weight: bold;
	color: #333;
}

.tpztlist-top-more {
	display: none;
	float: right;
	margin: 5px 6px 0px 0px;
	width: 41px;
	height: 17px;
}

.tpztlist-top-more-link {
	text-decoration: none;
	width: 41px;
	height: 17px;
	display: block;
	background: url(images/more1.gif) no-repeat;
}

.tpztlist-top-more-link:hover {
	width: 41px;
	height: 17px;
	display: block;
	background: url(images/more2.gif) no-repeat;
}

.tpztlist-top-tabs {
	border-top: solid 1px #9cd9f5;
	margin: 0px;
	padding: 0px;
	display: block;
}

.tpztlist-top-tabs ul {
	width: 100%;
	border-top: solid 1px #9cd9f5;
	margin: 0px;
}

.tpztlist-top-tabs .unselected {
	overflow: hidden;
	color: #505050;
	height: 26px;
	line-height: 26px;
	background: url(images/480_box_normal.gif) repeat-x;
	list-style: none;
	float: left;
	padding: 0px 2px 0px 2px;
	width: 115px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	border-bottom: solid 1px #a8ccee;
	border-left: solid 1px #a8ccee;
	border-collapse: separate;
	font-size: 12px;
	font-family: 宋体;
}

.tpztlist-top-tabs .selected {
	overflow: hidden;
	color: darkblue;
	font-weight: bold;
	text-decoration: none;
	height: 26px;
	line-height: 26px;
	background: url(images/480_box_select.gif) repeat-x;
	list-style: none;
	float: left;
	padding: 0px 2px 0px 2px;
	width: 115px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	border-bottom: solid 0px #9cd9f5;
	border-left: solid 1px #9cd9f5;
	font-size: 12px;
	font-family: 宋体;
}

.tpztlist-content {
	width: 100%;
}

.tpztlist-content-tab ul {
	margin: 5px 0px 0px 0px;
	padding: 0px;
}

.tpztlist-content-tab li {
	border-top: dashed 1px #505050;
	font-size: 12px;
	font-family: 宋体;
	list-style: none;
	clear: both;
	height: 132px;
}
.tpztlist-content-tab li>img{
	width:150px;
	height:110px;
	margin:5px;
	float: left;
	display: block;
	border:solid 1px #b0b0b0;
	padding:5px;
	background-color: white;
}
.tpztlist-content-tab a {
	width: 480px;
	text-decoration: none;
	color: #333;
	line-height: 30px;
	display: block;
	height: 30px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 14px;
	font-family: 宋体;
	font-weight: bold;
	float:left;
}

.tpztlist-content-tab span {
	font-size: 12px;
	float: left;
	width: 60px;
	display: block;
	line-height: 30px;
	height:30px;
}
.tpztlist-content-tab li div.summary{
	width: 635px;
	text-decoration: none;
	color: #333;
	line-height: 150%;
	font-size: 12px;
	font-family: 宋体;
}
.tpztlist-content-tab .text {
	text-align: center;
	line-height: 26px;
	margin: 6px auto;
	font-size: 14px;
}

.tpztlist-content-tab a:hover {
	color: #014b90;
	background-color: #f0f0f0;
}



.tpztlist-content-tab li:FIRST-CHILD {
	border-top: solid 0px skyblue;
}

</style>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.ksyzt.js"></script>

<script type="text/javascript">
	function load() {

		$(".stylish").makeStylish();

	}
	$(document).ready(load);
</script>
</head>

<body>
	<div class="wrap">
		<div class="wrap_center">
			<jsp:include page="../include/top.jsp" />

			
			<table class="w_970" cellpadding="0" cellspacing="0" >
				<tr>
					<td class='left-back-td' valign="top" >
						<div class="left-back-top">
							<div class="stylish {css:'columnlist'}">
								<%=app.columnlist2html(cid,subcid)%>
							</div>
						</div>
					</td>
					<td valign="top">
						<div class="pagenavi">
						<div class='navibar-left'></div>
						<div class='navibar-middle'>
							<%=app.column2navi(subcolumn == null ? column : subcolumn)%>
							<form style="display: inline;" action="news/search.jsp"
								method="get" enctype="application/x-www-form-urlencoded">
								<table style="float:right;margin-top: 4px;">
									<tr>
										<td><select name="type" class='search_select'>
												<option value="0" selected="selected">内容</option>
												<option value="1">标题</option>
										</select></td>
										<td><input name="w" type="text" value="" /></td>
										<td><input type="submit" value="搜索" />
										</td>
									</tr>
								</table>
							</form>

						</div>
						<div class='navibar-right'></div>
					</div>
					<div class='pagecontent'>

						<%
							if (subcolumn != null
									&& subcolumn.getCOLUMNTYPE() == ColumnType.CT_ARTICLE) {
								out.print("<div class='article'>");
								out.print(app.singlearticle2html(subcolumn.getID()));
								out.print("<script type='text/javascript'>install_article_tools();</script>");
								out.print("</div>");
							} else if (subcolumn != null) {
						%>
						<div class="stylish {css:'<%=style%>'}">
							<%=app.column2html(subcolumn.getID(), navidata, false,
						showpicture, app.ORDER_BY_DATE)%>
						</div>
						<%
							} else {
						%>
						<div class="stylish {css:'<%=style%>'}">
							<%=app.column2html(column.getID(), navidata, false, showpicture,
						app.ORDER_BY_DATE)%>
						</div>
							<%
								}
							%>
						

						<!-- page navi -->
						<div class='news-navi'>

							<%
								out.print(app.toPagesNavigatorBar(navidata));
							%>
						</div>
					</div>
					</td>
				</tr>
			</table>
			
		</div>
	</div>
	<jsp:include page="../include/bottom.jsp" />
	<%
	if (subcolumn != null
	&& subcolumn.getCOLUMNTYPE() == ColumnType.CT_ARTICLE){ 
	%>
		<script id="bdshare_js" type="text/javascript" data="type=button&uid=664845" src="http://bdimg.share.baidu.com/static/js/bds_s_v2.js?cdnversion=381133"></script>
	
	<%} %>
</body>
</html>
